package com.cn.wanxi.thread;

public class Test {
    public static void main(String[] args) {
        /**
         * 开启线程的步骤
         * 1.创建线程
         * 2.线程就绪
         */
        MyThread myThread = new MyThread();
//        myThread.run();//表示普通调用
        myThread.setName("THREAD1");
        myThread.start();//线程就绪
        MyThread myThread1 = new MyThread();
        myThread1.setName("THREAD2");
        myThread1.start();
        MyThread myThread2 = new MyThread();
        myThread2.setName("THREAD3");
        myThread2.start();
        MyThread myThread3 = new MyThread();
        myThread3.setName("THREAD4");
        myThread3.start();
        //线程执行顺序随机，不是根据书写顺序执行
    }
}
